1. Field of the Invention
The present invention relates to a method for generating a threshold pattern and a gradation image binarizing device used for binarizing processing of color images.
2. Description of the Related Art
A photograph image of a newspaper is printed using aggregate of many dots. Such an image is called a xe2x80x9cdot imagexe2x80x9d. To print an image having gradation like a photograph by using a binary output medium such as a dot printer, image data obtained in advance by picture-taking must be converted to a dot image. A color of dot, screen angle and a number of lines are used as parameters indicating the property of the dot image. FIG. 2 is an explanatory diagram showing a screen angle of a dot image, FIG.2 (a) showing a relation between the screen angle and the number of lines and FIG. 2 (b) showing a typical arrangement of the screen angle.
As shown in the drawing, dots 1 indicated by black round points are so placed as to be aligned at an equal interval in the direction of the arrow. The arrow 2 is referred to as a line. The screen angle is an angle which the line forms with a horizontal line (a line parallel to prime scanning line). In the example shown in the drawing, the dot image is so configured that the screen angle is 45 degrees. The number of lines is one per a inch counted when a lot of lines drawn at an equal interval and in parallel are traced in the vertical direction. In the case of a black-and-white image, if the screen angle is set to 45 degrees, the dot image can be produced which is relatively hard to distinguish when seen by the naked eye.
For color printing, dots each having one of 3 or 4 color components (cyan, magenta, yellow and black) are combined to produce a color. If dots having a different color and/or shape are arranged regularly, streaking called xe2x80x9cmoirexe2x80x9d shows. For the purpose of reducing such moire and making the dot inconspicuous, the use of the screen angle being different for every color component is widely known.
FIG. 2 (b) shows a screen angle suitable for every color component which is applicable to printing of a color image. The screen angle for a black color being most perceivable by the naked eye is set to 45 degrees. Further, the screen angle for a yellow color being most inconspicuous and light is set to 0 (zero).
On the other hand, the screen angle for a magenta or cyan color is set to an intermediate angle, for example, 75 and 15 degrees respectively. Each color component is perceived in a different way when seen by the naked eye, and the most suitable screen angle must be selected accordingly.
However, the conventional technologies as described above have the following problems to be solved.
The Dither method and/or Dot pattern method are used for printing a gradation image composed of the dot as described above. The principles of these methods are described below.
Each value of a picture element (i.e., density of a picture element) is represented by, for example, 16 step multivalued data. A gradation of one picture element is represented by a cluster of 4xc3x974 dots. For example, if the value of a picture element is xe2x80x9c0xe2x80x9d (zero), all 4xc3x974 dots become a white color; and if it is xe2x80x9c6xe2x80x9d, out of the 4xc3x974 dots, 6 dots become a black color and the remaining dots being a white color. The larger the value of a picture element becomes, the more the black dots increase in number. By selecting the proper position of black dots, the quality of an image obtained when a cluster of dots are seen by the naked eye at a short distance is improved
In order to automatically select either of a black or a white color, the Dither pattern method uses a matrix in which, for example, 4xc3x974 threshold values are assigned therein. For example, if a value of a picture element of an input gradation image is xe2x80x9c6xe2x80x9d, this value of the picture element is compared with each of 4xc3x974 threshold values. When the value of the picture element exceeds a threshold value, the dot existing at the position is made a black color. If the value of the picture element is less than the threshold value, the dot existing at the position is made a white color. Such binarizing processing allows the selection of either of a black or white color of each dot.
Generally, a dither pattern is represented by a square where a threshold value is assigned at a pitch of dots. In order to align binarized dots in the direction of a screen angle, the rotation of an edge of the dither pattern by an angle of the screen angle is required.
FIG. 3 is an explanatory diagram illustrating a method for rotating a dither pattern. FIG. 3 (a) shows an example of a rotation matrix adapted to be rotated by operational processing of the dither pattern. FIG. 3 (b) shows a result obtained from the rotation of the dither pattern.
As depicted in FIG. 3 (a), for example, a point at a position (X, Y) on the XY coordinates is rotated relative to an origin at an angle of xcex8 in a counterclockwise direction. At this point, the position on the coordinates obtained after being rotated is (Xxe2x80x2, Yxe2x80x2). A rotation matrix used to obtain the position (Xxe2x80x2, Yxe2x80x2) of the coordinates obtained after being rotated from the position (X, Y) existing before being rotated is shown in the drawing. In the right side of the formula, a coefficient of the position (X, Y) corresponds to the rotation matrix.
By expanding this formula, the following equations are gotten.
Xxe2x80x2=cos xcex8X sin xcex8Y
Yxe2x80x2=sin xcex8X cos xcex8Y
Thus, by performing operational processing of a determinant, the conversion from original coordinates (X, Y) to coordinates (Xxe2x80x2, Yxe2x80x2) obtained after being rotated is made possible.
An input pattern shown on the left side in FIG. 3 (b) is the dither pattern composed of 4xc3x974 threshold values. The numbers 1 to 16 are assigned sequentially, from the upper left, to each threshold value of this input pattern. The 4xc3x974 dots are binarized then.
For example, the input pattern is rotated relative to a position indicated as xe2x80x9c1xe2x80x9d at the upper left corner in a counterclockwise direction by an angle of 0 . In this case, the coordinates of the site having the 4xc3x974 threshold values are obtained and converted using the rotation matrix. The results are shown on the right side of the drawing.
Moreover, fractions of the coordinate values obtained by the operational processing are processed by its omission or by counting fractions as one. The site where the dot is arranged is limited to a certain position specified by a structure of a dot image. Each threshold value is always assigned to any of the dots and is used for binarizing processing of the dot. In an area in which a hatching is assigned, a site not corresponding to an input pattern appears. This is because an interval distance between dots remains unchanged even though each side of the dither pattern is made longer due to the rotation of the dither pattern. If nothing is done here, a hole occurs in the dither pattern. To prevent this, the following processing is carried out.
A re-sampling method is introduced by which, in views of convenience of the operational processing, an inverse operation of the coordinates of a site where all threshold values obtained after the rotation are to be assigned is performed and, by using this result, the corresponding threshold value is selected from that of the dither pattern existing before the rotation.
FIG. 4 is an explanatory diagram showing re-sampling processing of the dither pattern, FIG. 4 (a) illustrating the re-sampling and FIG. 4 (b) showing a coordinate system of the dither pattern.
As a first step, coordinates of a site are obtained where all the threshold values of the dither pattern obtained after being rotated are assigned therein. Using the coordinates at 20 positions as shown on the right side in FIG. 4 (a), an inverse operation is performed of the coordinates of a site where a threshold value of the dither pattern existing before being rotated shown on the left side in FIG. 4 (a) is assigned. When fractions of the coordinates obtained by the inverse operation are processed by rounding, the coordinates indicate a site of any threshold included in the dither pattern shown in the left. The resulting threshold value is applied to that contained in the pattern obtained after being rotated. By this method, a dither pattern being free from a hole can be obtained. The processing is called xe2x80x9cre-sampling processingxe2x80x9d.
Furthermore, the dither pattern is displayed as shown in FIG. 4 (b) and a point in its upper left is designated as an origin. An X axis is set in the horizontal direction toward the right and Y axis in the vertical direction downward. In the calculation of the rotation shown in FIG. 3 (a), a rotation angle xcex8 is set in a counterclockwise direction. On the other hand, in the coordinate system as depicted in FIG. 4 (b), the rotation angle xcex8 is set in a clockwise direction by an arrow 3 in the drawing.
FIG. 5 shows an image and dither pattern binarized according to the conventional method. FIG. 5 (a) is a binarized image obtained by the rotation processing. FIG. 5 (b) is an example of rotation of the dither pattern.
In the example, by using such a conventional re-sampling method, a dither pattern of 4xc3x974 configurations is rotated by 14 degrees in a counterclockwise direction. Each dither pattern is enclosed by a polygonal line. In this state, when a uniform gray image with a density of 25% is binarized, results as shown in FIG. 5 (a) appears.
As depicted in FIG. 5 (b), a shape of the dither pattern obtained after being rotated varies depending on a site and, when compared with that existing before being rotated, the overlapping or shortage in the threshold has occurred. That is, when compared with the dither pattern shown on the left side in FIG. 4 (a), the conventional dither pattern cannot represent faithfully the density of an original image due to a difference in allocated thresholds. For this reason, as seen in FIG. 5 (a), it is impossible to obtain a uniform gray image expected originally and a certain amount of streaking called moire caused by the disturbance in a pattern appears.
In view of the above, it is an object of the present invention to provide a method for generating a threshold pattern which can prevent the occurrence of moire by rotating the same.
Another object of the present invention is to provide a method for generating a threshold pattern which can prevent the moire that may occur at the time of the conversion from an image having a uniform and intermediate density to a dot image.
A further object of the present invention is to provide a gradation image binarizing device which can perform binarizing processing by setting a free screen angle for each color component used to represent a color image, thus implementing a dot image of high quality. These objects are achieved by the following methods and a device:
1. A method for converting a gradation image each value of a picture element of which is represented by multivalues to a dot image having a specified screen angle and for generating a threshold pattern wherein a threshold value is assigned at a pitch of an array of said dot to binarize each value of said picture element comprising steps of:
setting an origin on a threshold pattern to be based on and obtaining real-number coordinates of an origin of an adjacent threshold pattern by rotating the threshold pattern relative to the above origin by a required screen angle; correcting coordinates of the origin of the adjacent threshold pattern so that the real-number coordinates are changed to integer coordinates by rounding fractions of the real-number coordinates; and
selecting, as a screen angle, an angle which a segment connecting an origin of the dither pattern to be based on and that of the adjacent dither pattern obtained after the correction forms with a horizontal line.
2. The method for rotating the threshold pattern wherein all threshold patterns obtained after being rotated used to cover all dot images to be outputted are adapted to have the same shape and wherein all values of each threshold assigned at a site corresponding to each threshold pattern are the same.
3. The method for rotating the threshold pattern wherein coordinates (X, Y) of the threshold pattern existing before being rotated are obtained by an operational processing of coordinates (Xxe2x80x2, Yxe2x80x2) of each threshold value of the threshold pattern obtained after being rotated, a threshold value assigned at coordinates (X,Y) of the threshold pattern before being rotated is selected and the selected threshold value is used as a threshold value of the threshold pattern obtained after being rotated.
4. The method for rotating the threshold pattern wherein, in the operational processing, affine transformation is performed using a magnification MUL of an edge of the threshold pattern and a corrected screen angle xcex8xe2x80x2 as factors.
5. A gradation image binarizing device comprising:
a threshold pattern storing section used to store a threshold pattern for binarization;
a gradation image storing section used to store a gradation image to be binarized by the threshold pattern;
a parameter storing section used to store a rotation parameter obtained from a screen angle after correction carried out in a manner that an origin is set on the pattern and real-number coordinates of an origin of an adjacent threshold pattern are obtained by rotating the threshold pattern relative to the origin by a required screen angle and that coordinates of the origin of the adjacent threshold pattern are corrected so that the real-number coordinates are changed to integer coordinates by rounding fractions of the real-number coordinates and an angle which a segment connecting an origin of the dither pattern to be based on and that of the adjacent dither pattern obtained after the correction forms with a horizontal line are selected as a screen angle; and a means for taking out a threshold value of the threshold pattern corresponding to coordinates obtained by conversion processing of coordinates of each picture element of the gradation image by using a rotation parameter stored in the parameter storing section and for binarizing the gradation image.